package main

import (
	_ "webgogo/routers"
	_ "webgogo/util"

	"github.com/astaxie/beego"
	"github.com/astaxie/beego/orm"
	"webgogo/util"
)

func init() {
	orm.RegisterDriver("mysql", orm.DRMySQL)
	orm.RegisterDataBase("default", beego.AppConfig.String("DB_TYPE"), beego.AppConfig.String("DB_URL"))

	util.Ormer = orm.NewOrm()
	util.Ormer.Using("default")
}

func main() {
	if beego.BConfig.RunMode == "dev" {
		beego.BConfig.WebConfig.DirectoryIndex = true
		beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
	}


	beego.Run()
}
